package cn.tedu.audit.controller;


import cn.tedu.audit.pojo.dto.AuditQuery;
import cn.tedu.audit.pojo.vo.AuditVO;
import cn.tedu.audit.service.AuditService;
import cn.tedu.response.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/audit/")


public class AuditController {
    @Autowired
    AuditService auditService;

    @GetMapping("select")
    public ResponseResult selectAudit(AuditQuery auditQuery){
        log.debug("查询审批数据:auditQuery={},auditQuery");
        List<AuditVO> auditVOList = auditService.selectAuditByApplicationId(auditQuery.getId());
        return ResponseResult.ok(auditVOList);
    }
}
